// 本文件用于：带数据筛选的下拉框
import { Select } from 'antd';
import React, { memo } from 'react';

export default memo((props: any) => {
  const labelName = props?.fieldNames?.label || 'label';

  /** 筛选方法 */
  const filterOption = (input: string, option?: any) => {
    return (option[labelName] ?? '').toLowerCase().includes(input.toLowerCase());
  };

  return <Select showSearch allowClear filterOption={filterOption} {...props}></Select>;
});
